package org.nf.web.common.convertor;

import cn.hutool.core.date.DateUtil;
import org.nf.web.common.TypeConvertor;

import java.util.Date;

/**
 * @author zhu
 * @date 2024-05-17
 */
public class DateConvertor implements TypeConvertor {
    @Override
    public Object convert(String requestParam) {
        return DateUtil.parse(requestParam).toJdkDate();
    }

    @Override
    public boolean supports(Class<?> type) {
        return type.equals(Date.class);
    }
}
